#include "gui_menu_func.h"
#include "sys_stdio.h"

static GUI_OBJECT(function_setting);
    static GUI_OBJECT(voice_setting);
        static GUI_OBJECT(voice_setting_number);
    static GUI_OBJECT(screen_setting);
        static GUI_OBJECT(reset_screen);
        static GUI_OBJECT(single_screen);
        static GUI_OBJECT(double_screen);
        static GUI_OBJECT(four_screen);
        static GUI_OBJECT(six_screen);
        static GUI_OBJECT(nine_screen);
    static GUI_OBJECT(lcd_backlight);
        static GUI_OBJECT(backlight_default);
        static GUI_OBJECT(backlight_light);

static int voice_setting_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"设置成功",0);
    sj_kprintf("音量设置 \r\n");

    out:
    return ret;
}

static int reset_screen_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"恢复默认设置成功",0);
    sj_kprintf("恢复默认 \r\n");

    out:
    return ret;
}

static int single_screen_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"单画面设置设置成功",0);
    sj_kprintf("单画面设置 \r\n");

    out:
    return ret;
}

static int double_screen_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"双画面设置设置成功",0);
    sj_kprintf("双画面设置 \r\n");

    out:
    return ret;
}

static int four_screen_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"四画面设置设置成功",0);
    sj_kprintf("四画面设置 \r\n");

    out:
    return ret;
}

static int six_screen_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"六画面设置设置成功",0);
    sj_kprintf("六画面设置 \r\n");

    out:
    return ret;
}

static int nine_screen_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"九画面设置设置成功",0);
    sj_kprintf("九画面设置 \r\n");

    out:
    return ret;
}

static int backlight_default_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"背光默认设置设置成功",0);
    sj_kprintf("背光默认设置 \r\n");

    out:
    return ret;
}

static int backlight_light_content(struct lcd_display_tools *tools)
{
    int ret =0;
    if(tools->display==NULL)
    {
        goto out;
    }
    tools->display(0,0,"背光常亮设置设置成功",0);
    sj_kprintf("背光常亮设置 \r\n");

    out:
    return ret;
}


void gui_menu_add_function(struct gui_object *menu)
{
    gui_object_init(&function_setting,"功能设置");
        gui_object_init(&voice_setting,"音量设置");

        gui_object_init(&screen_setting,"画面设置");
            gui_object_init(&reset_screen,"恢复默认");
            gui_object_init(&single_screen,"单画面");
            gui_object_init(&double_screen,"双画面");
            gui_object_init(&four_screen,"四画面");
            gui_object_init(&six_screen,"六画面");
            gui_object_init(&nine_screen,"九画面");

        gui_object_init(&lcd_backlight,"LCD屏背光");
            gui_object_init(&backlight_default,"默认");
            gui_object_init(&backlight_light,"常亮");
    gui_object_add_child(menu,&function_setting);
        gui_object_add_child(&function_setting,&lcd_backlight);
            gui_object_add_child(&lcd_backlight,&backlight_light);
            gui_object_add_content(&backlight_light,backlight_light_content);
            gui_object_add_child(&lcd_backlight,&backlight_default);
            gui_object_add_content(&backlight_default,backlight_default_content);

        gui_object_add_child(&function_setting,&screen_setting);
            gui_object_add_child(&screen_setting,&nine_screen);
            gui_object_add_content(&nine_screen,nine_screen_content);
            gui_object_add_child(&screen_setting,&six_screen);
            gui_object_add_content(&six_screen,six_screen_content);
            gui_object_add_child(&screen_setting,&four_screen);
            gui_object_add_content(&four_screen,four_screen_content);
            gui_object_add_child(&screen_setting,&double_screen);
            gui_object_add_content(&double_screen,double_screen_content);
            gui_object_add_child(&screen_setting,&single_screen);
            gui_object_add_content(&single_screen,single_screen_content);
            gui_object_add_child(&screen_setting,&reset_screen);
            gui_object_add_content(&reset_screen,reset_screen_content);

        gui_object_add_child(&function_setting,&voice_setting);
        gui_object_add_content(&voice_setting,voice_setting_content);

}
